/****************************************************************************
*  Arthea Server by R. Jennings (2007-2008)   http://arthea.googlecode.com/ *
*  By using this code you comply with the Artistic and GPLv2 Licenses.      *
****************************************************************************/


using System;

namespace Arthea.Util
{
    /// <summary>
    /// Implementation of randomizer. 
    /// </summary>
    public struct Randomizer
    {
        /// <summary>
        /// Random number generator
        /// </summary>
        private static readonly Random randomizer = new Random();


        /// <summary>
        /// Gets a random number.
        /// </summary>
        /// <returns>a random number</returns>
        public static int Next()
        {
            return randomizer.Next();
        }

        /// <summary>
        /// Gets a random number less than a max value.
        /// </summary>
        /// <param name="maxValue">The max value.</param>
        /// <returns>a random number</returns>
        public static int Next(int maxValue)
        {
            return randomizer.Next(maxValue);
        }

        /// <summary>
        /// Gets a random number specified by a range.
        /// </summary>
        /// <param name="minValue">The min value.</param>
        /// <param name="maxValue">The max value.</param>
        /// <returns>a random number</returns>
        public static int Next(int minValue, int maxValue)
        {
            return randomizer.Next(minValue, maxValue);
        }
    }
}